package pl.edu.pw.perg.compinfodb;

import org.springframework.richclient.application.ApplicationWindow;
import org.springframework.richclient.application.config.DefaultApplicationLifecycleAdvisor;
import org.springframework.richclient.command.ActionCommand;

public class CompInfoDBLifecycleAdvisor extends DefaultApplicationLifecycleAdvisor{

    /**
     * When commands are created, lookup the login command and execute it.
     */
//    public void onCommandsCreated(ApplicationWindow window)
//    {
//        ActionCommand command = (ActionCommand) window.getCommandManager().getCommand("loginCommand", ActionCommand.class);
//        command.execute();
//    }
    
    @Override
    public void onWindowCreated(ApplicationWindow window) {
        ActionCommand command = (ActionCommand) window.getCommandManager().getCommand("loginCommand", ActionCommand.class);
        command.execute();
    }
    
}
